import React from 'react';
import { Checkbox, Radio } from 'antd';

interface IChoiceLabelProps {
  value: string[];
  current?: string | string[];
  onClick?: (lb: string, rgb?: string) => void;
}

const SingleChoiceLabel = (props: IChoiceLabelProps) => {
  const { value, current, onClick } = props;

  return (
    <>
      <div style={{ display: 'flex', alignItems: 'center' }}>
        {value.map((it: string) => (
          <div key={it} style={{ paddingRight: '10px' }}>
            <Radio
              checked={current === it}
              onChange={(e: any) => {
                onClick && onClick(it);
              }}
            >
              {it}
            </Radio>
          </div>
        ))}
      </div>
    </>
  );
};

export default SingleChoiceLabel;
